import { Injectable } from '@angular/core';

@Injectable()
export class StudentService {
  public students: Student[];

  constructor() {
    this.students = [
      new Student(1, 'fury', '重庆市沙坪坝区', 'SpringBoot', '三峡广场' ),
      new Student(2, 'zeus', '重庆市合川区', 'Angular2', '钓鱼城'),
      new Student(3, 'warrior', '重庆市永川区', 'SpringCloud', '竹海'),
      new Student(4, 'bob', '重庆市大足区', 'SpringMVC', '大足石刻'),
      new Student(5, 'peter', '重庆市北碚区', 'MyBatis', '缙云山'),
    ];
  }

  getStudents() {
    return this.students;
  }

}

export class Student {
  constructor(
    public id: number,
    public name: string,
    public address: string,
    public subject: string,
    public description: string
  ) {}
}
